Completed
Branch master (680841)
by Antoine
54s
created

module.exports   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
module.exports = function (shipit) {
2
  shipit.blTask('initVirtualenv', function() {
3
    return shipit.remote(
4
      "cd " + shipit.releasePath +
5
      " && virtualenv venv -p /usr/bin/python3" +
6
      " && source venv/bin/activate" +
7
      " && pip install --upgrade pip"
8
    );
9
  });
10
11
  shipit.blTask('installVendors', function() {
12
    return shipit.remote(
13
      "cd " + shipit.currentPath +
14
      " && source venv/bin/activate" +
15
      " && pip install --find-links=~/wheels -r requirements.txt --upgrade"
16
    );
17
  });
18
19
  shipit.blTask('upgradeDatabase', function() {
20
    return shipit.remote(
21
      "cd " + shipit.currentPath +
22
      " && source venv/bin/activate" +
23
      " && set -a && source " + shipit.config.deployTo + "/password.conf" +
24
      " && export PYTHONPATH=src" +
25
      " && cd " + shipit.currentPath +
26
      " && python3 src/manage.py db upgrade"
27
    );
28
  });
29
30
  shipit.blTask('install', function() {
31
    if(shipit.config.hasDatabase){
32
      var tasks = ['installVendors', 'upgradeDatabase', 'restartServer']
33
    } else {
34
      var tasks = ['installVendors', 'restartServer']
0 ignored issues
show
Comprehensibility Naming Best Practice introduced by
The variable tasks already seems to be declared on line 32. Consider using another variable name or omitting the var keyword.

This check looks for variables that are declared in multiple lines. There may be several reasons for this.

In the simplest case the variable name was reused by mistake. This may lead to very hard to locate bugs.

If you want to reuse a variable for another purpose, consider declaring it at or near the top of your function and just assigning to it subsequently so it is always declared.

Loading history...
35
    }
36
    shipit.start(tasks, function(err) {
37
      if(!err){
38
        shipit.log('Install done!');
39
      }
40
    })
41
  });
42
43
  shipit.on('updated', function() {
44
      return shipit.start('initVirtualenv');
45
  });
46
};
47